package jgl.vajra.management.part.order.activity;

import com.orhanobut.logger.Logger;

import jgl.vajra.management.R;
import jgl.vajra.management.databinding.ActivityReceivingSettingBinding;
import jgl.vajra.management.part.order.viewModel.ReceivingSettingViewModel;
import jgl.vajra.management.widget.mvvm.factory.CreateViewModel;
import jgl.vajra.management.widget.mvvm.view.BaseMVVMActivity;

@CreateViewModel(ReceivingSettingViewModel.class)
public class ReceivingSettingActivity extends BaseMVVMActivity<ReceivingSettingViewModel, ActivityReceivingSettingBinding> {

    @Override
    public int getLayoutId() {
        return R.layout.activity_receiving_setting;
    }

    @Override
    public void initView() {
        super.initView();

        mBinding.bSeekBar.setOnSeekBarChangeListener((leftProgress, rightProgress) -> {
            Logger.d("left=" + leftProgress + " right=" + rightProgress);
            String timeStart;
            String timeEnd;
            if (leftProgress < 10) {
                timeStart = "0" + leftProgress + ":00";
            } else {
                timeStart = leftProgress + ":00";
            }
            if (rightProgress < 10) {
                timeEnd = "0" + rightProgress + ":00";
            } else {
                timeEnd = rightProgress + ":00";
            }

            mBinding.tvTime.setText(timeStart+"～"+timeEnd);
        /*    mBinding.tvTimeStart.setText(timeStart);
            mBinding.tvTimeEnd.setText(timeEnd);*/
        });
    }
}
